/*
 * BuilderAspect.h
 *
 *  Created on: Nov 3, 2008
 *      Author: Ryan
 */

#ifndef BUILDERASPECT_H_
#define BUILDERASPECT_H_

#include "UnitAspect.h"
#include "../Unit.h"

#include <set>
#include <boost/shared_ptr.hpp>

namespace OOInterface
{

class Unit;
typedef boost::shared_ptr< const Unit > ConstUnitPtr;

typedef std::set< ConstUnitPtr > ConstUnitSet;

class BuilderAspect: public UnitAspect
{
public:
	BuilderAspect( const ConstUnitSet& set );
	virtual ~BuilderAspect();

	virtual void accept( UnitVisitor& v ) const { v.visitBuilderAspect( *this ); }

	virtual std::string toString() const;

	const ConstUnitSet& getBuildableUnits() const { return _buildableUnits; }

	bool canBuild( ConstUnitPtr building ) const;

	float getBuildDistance() const { return _buildDistance; }

	float getBuildSpeed() const { return _buildSpeed; }
	float getRepairSpeed() const { return _repairSpeed; }
	float getCaptureSpeed() const { return _captureSpeed; }
	float getReclaimSpeed() const { return _reclaimSpeed; }

	void setBuildDistance( float distance ) { _buildDistance = distance; }
	void setBuildSpeed( float speed ) { _buildSpeed = speed; }
	void setRepairSpeed( float speed ) { _repairSpeed = speed; }
	void setCaptureSpeed( float speed ) { _captureSpeed = speed; }
	void setReclaimSpeed( float speed ) { _reclaimSpeed = speed; }

private:
	float _buildDistance;

	float _buildSpeed;
	float _repairSpeed;
	float _captureSpeed;
	float _reclaimSpeed;

	ConstUnitSet _buildableUnits;
};

}

#endif /* BUILDERASPECT_H_ */
